package program;

public class Konto {
	private int saldo = 0; //Start sum for spillerne
	/*
	0 = "Null", 
	1 = Blue, 
	2 = Orange, 
	3 = GreenYellow, 
	4 = LightBlue, 
	5 = Red, 
	6 = White, 
	7 = Yellow, 
	8 = "8",
	9 = Brewery
	10 = Shipping
	*/
	int[][][] owned = new int[11][5][2];
	
	public Konto(){
		saldo = 30000;
	}
	
	// Tr詭ker withdrawValue fra summen, returner false hvis sum g蚌 under 0.
	public boolean withdraw(int withdrawValue){
		if(saldo - withdrawValue < 0){
			saldo = 0;
			return false;
		}
		else{
			saldo = saldo - withdrawValue;
			return true;
		}
	}
	
	// Tilfer depositValue til sum
	public void deposit(int depositValue){
		saldo = saldo + depositValue;
	}
	
	public int getSaldo(){
		return saldo;
	}
	
	//fx. type = shipping, changeOwn = true
	//Ville give kontoen +1 shipment ejet, hvilket 誅dre payment for shipping og brewery etc.
	public void setOwned(int[][][] newOwned){ //fx. Hvis newOwned = {0,1} s�ejer kontoen +1 Brewery
		for(int i = 0; i < 11; i++){
			for(int k = 0; k < 4; k++){
				owned[i][k][0] += newOwned[i][k][0];
				owned[i][k][1] += newOwned[i][k][1];
			}
		}
	}
	
	public int[][][] getOwned(){
		return owned;
	}
	
	
}
